home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C++ / Applications / Nuntius 1.2 / src / Nuntius / UDiscListCmds.cp < prev    next >
Encoding:
Text File  |  1994-02-20  |  1.6 KB  |  64 lines  |  [TEXT/MPS ]

  1. // Copyright © 1992 Peter Speck, speck@dat.ruc.dk. All rights reserved.
  2. // UDiscListCmds.cp
  3.  
  4. #include "UDiscListCmds.h"
  5. #include "UArticleListView.h"
  6. #include "UDiscListView.h"
  7. #include "UGroupDoc.h"
  8. #include "UPrefsDatabase.h"
  9.  
  10. #include <RsrcGlobals.h>
  11.  
  12. #include <UPrinting.h>
  13.  
  14. #pragma segment MyGroup
  15.  
  16.  
  17. //-------------------------------------------------------------------
  18. TOpenArticleCommand::TOpenArticleCommand()
  19. {
  20. }
  21.  
  22. void TOpenArticleCommand::IOpenArticleCommand(TGroupDoc *doc, 
  23.                                                         TLongintList *discIndexList, 
  24.                                                         Boolean removeSelection)
  25. {
  26.     inherited::ICommand(cOpenArticle, nil, false, false, nil);
  27.     fDoc = doc;
  28.     fDiscIndexList = discIndexList;
  29.     fRemoveSelection = removeSelection;
  30. }
  31.  
  32. pascal void TOpenArticleCommand::Free()
  33. {
  34.     inherited::Free();
  35. }
  36.  
  37. pascal void TOpenArticleCommand::DoIt()
  38. {
  39.     TWindow *window;
  40.     window = gViewServer->NewTemplateWindow(kArticleView, fDoc);
  41.     CRect maxResize(window->fResizeLimits);
  42.     maxResize.right = 650; //@@ hack
  43.     window->SetResizeLimits(maxResize[topLeft], maxResize[botRight]);
  44.     gPrefs->GetSilentWindowPosPrefs('WArt', window);
  45.     TArticleListView *alView;
  46.     alView = (TArticleListView*) window->FindSubView(kArticleListViewID);
  47.     if (!alView) {
  48. #if qDebug
  49.         ProgramBreak("UPS: did not find TArticleListView!");
  50. #endif
  51.         FailOSErr(errMissingClass);
  52.     }
  53.  
  54.     alView->SetArticleList(fDiscIndexList);
  55.  
  56.     TStdPrintHandler *aHandler = new TStdPrintHandler;
  57.     aHandler->IStdPrintHandler(fDoc, alView, !kSquareDots, kFixedSize, !kFixedSize);
  58.  
  59. //    if (fRemoveSelection)
  60. //        fDoc->GetDiscListView()->SetEmptySelection(kHighlight);
  61. }
  62.  
  63. //-------------------------------------------------------------------
  64.